package Flyweight_Pattern.Java;

// -*-coding:utf-8 -*-
//人员：刘陆鑫
//班级：19软3
//学号；2019110218
public class Client {
    public static void main(String[] args) {
        Monitor monitor1,monitor2,monitor3,monitor4;
        Monitor_Factory factory;
        factory=Monitor_Factory.getInstance();
        monitor1=factory.getMonitor("J");
        monitor2=factory.getMonitor("A");
        monitor3=factory.getMonitor("V");
        monitor4=factory.getMonitor("A");
        monitor1.show(new Size(25),new Color("blue"));
        monitor2.show(new Size(26),new Color("red"));
        monitor3.show(new Size(21),new Color("yellow"));
        monitor4.show(new Size(23),new Color("green"));
        System.out.println("两个a是否相同" + (monitor2==monitor4));
        
    }
}
